from common_data import *
import sqlobject
import os

def connectToDb():

    # create db connection
    sqlobject.sqlhub.processConnection = sqlobject.connectionForURI( 'mysql://root:@localhost/eus' )
    
    # create required tables, if necessary
    DNSServerConfig.createTable( ifNotExists = True )
    DNSResolver.createTable( ifNotExists = True )
    User.createTable( ifNotExists=True )
    Party.createTable( ifNotExists=True )
    Checkout.createTable( ifNotExists=True )
    Environment.createTable( ifNotExists=True )
    ResourceRecord.createTable( ifNotExists=True )
    
    